﻿using Jay.Sc2.Bof.Lib.State;

namespace Jay.Sc2.Bof.Lib.Action
{
	public abstract class ActionHarvestGas : Action
	{
		public override bool CanExecute(IBuildOrder bo) { return base.CanExecute(bo) && bo.State.WorkersOnMinerals > 0; }
		public override bool HaveResources(IBuildOrder bo) { return bo.State.GasBuilding.Count * 3 > bo.State.WorkersOnGas; }
		public override bool HaveTechnology(IBuildOrder bo) { return bo.State.GasBuilding.Count > 0; }
		public override bool IsInvalid(IBuildOrder bo) { return bo.State.GasBuilding.Total == 0; }
		public override void Execute(IBuildOrder bo)
		{
			bo.State.WorkersOnMinerals--;
			bo.State.WorkersOnGas++;
		}
	}
}
